﻿using Elektronix.Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Elektronix
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

            user u = new user();
            u.parola = txtParola1.Text;
            u.email = txtEmail.Text;
            u.login();
            if (u.userID !=null && u.namesurname != null)
            {
                Session["userID"] = u.userID;
                Session["email"] = u.email;
                Session["namesurname"] = u.namesurname;
                Session["telefon"] = u.telefon;

                Response.Redirect("default.aspx");
            }
            else
            {
                Response.Redirect("error.aspx?err=01");
            }
        }
    }
}